package com.dingli.servlet;

import com.dingli.DAO.RoleLevelDAO;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet(name = "AdminManageServlet", value = "/adminManage")
public class AdminManageServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        RoleLevelDAO roleLevelDAO = new RoleLevelDAO();
        List<Map<String, Object>> levels = roleLevelDAO.getTicketLevel();
        request.setAttribute("levels", levels);
        request.getRequestDispatcher("/views/adminManage.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }
}

